import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    singer:{}
  },
  mutations: {
    saveSinger(state,singer){
        state.singer = singer
    }
    },
    actions:{
        saveSinger(context,singer){
            //提交（connit）mutations
            context.commit('saveSinger',singer)
        }
    }
})

export default store